home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-02 | 1.3 KB | 90 lines | [TEXT/MPS ] |
-
- // ProductInformation.c
- // Defines for Accessing Product Information
- // April 27, 1994
-
- // Copyright © 1994, Teknosys, Inc.
-
-
- #include <Errors.h>
- #include <Files.h>
- #include <Memory.h>
- #include <Resources.h>
- #include <Types.h>
-
- #include "ProductInformation.h"
-
-
- long GetVersionNumber(short versionID)
- {
- long result;
- Handle hVersion;
-
- hVersion = GetResource(kVersionResType, versionID);
-
- if (hVersion)
- {
- result = *(long*) *hVersion;
-
- ReleaseResource(hVersion);
- }
- else
- result = 0;
-
- return (result);
- }
-
-
- OSErr GetVersionNumberString(short versionID, Str255 str)
- {
- OSErr error;
- Handle hVersion;
- StringPtr ptr;
-
- hVersion = GetResource(kVersionResType, versionID);
-
- if (hVersion)
- {
- HLock(hVersion);
-
- ptr = (StringPtr) (*hVersion + sizeof(NumVersion) + sizeof(short));
-
- BlockMove(ptr, str, ptr[0] + 1);
-
- ReleaseResource(hVersion);
- }
- else
- error = resNotFound;
-
- return (error);
- }
-
-
- OSErr GetVersionMessage(short versionID, Str255 message)
- {
- OSErr error;
- Handle hVersion;
- StringPtr ptr;
-
- hVersion = GetResource(kVersionResType, versionID);
-
- if (hVersion)
- {
- HLock(hVersion);
-
- ptr = (StringPtr) (*hVersion + sizeof(NumVersion) + sizeof(short));
- ptr += ptr[0] + 1;
-
- BlockMove(ptr, message, ptr[0] + 1);
-
- ReleaseResource(hVersion);
- }
- else
- error = resNotFound;
-
- return (error);
- }
-
-
-
-